home *** CD-ROM | disk | FTP | other *** search
/ Introduction to 3D Game …ogramming with DirectX 12 / Introduction-to-3D-Game-Programming-with-DirectX-12.ISO / Code.Textures / Chapter 12 The Geometry Shader / TreeBillboards / FrameResource.cpp next >
C/C++ Source or Header  |  2016-03-02  |  790b  |  20 lines

  1. #include "FrameResource.h"
  2.  
  3. FrameResource::FrameResource(ID3D12Device* device, UINT passCount, UINT objectCount, UINT materialCount, UINT waveVertCount)
  4. {
  5.     ThrowIfFailed(device->CreateCommandAllocator(
  6.         D3D12_COMMAND_LIST_TYPE_DIRECT,
  7.         IID_PPV_ARGS(CmdListAlloc.GetAddressOf())));
  8.  
  9.   //  FrameCB = std::make_unique<UploadBuffer<FrameConstants>>(device, 1, true);
  10.     PassCB = std::make_unique<UploadBuffer<PassConstants>>(device, passCount, true);
  11.     MaterialCB = std::make_unique<UploadBuffer<MaterialConstants>>(device, materialCount, true);
  12.     ObjectCB = std::make_unique<UploadBuffer<ObjectConstants>>(device, objectCount, true);
  13.  
  14.     WavesVB = std::make_unique<UploadBuffer<Vertex>>(device, waveVertCount, false);
  15. }
  16.  
  17. FrameResource::~FrameResource()
  18. {
  19.  
  20. }